package com.example.demo.domain.exam;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.example.demo.annotation.Display;
import com.example.demo.enums.QuestionType;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import java.util.List;

@Data
@TableName(value = "exam_paper_relation")
public class ExamPaperRelation {

    @Display("关联标识")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @Display("试卷标识")
    @TableField(value = "exam_paper_id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long paperId;

    @Display("题目标识")
    @TableField(value = "question_id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long questionId;

    @Display("题目类型")
    @TableField(value = "question_type")
    private QuestionType questionType;

    @Display("得分占比")
    @TableField(value = "percentage")
    private Double percentage;

    @Display("语言选择")
    @TableField(exist = false)
    private List<ExamPaperQuestionLanguage>  languageList;

}
